package com.example.demo.service;

import com.example.demo.mapper.UserMapper;
import com.example.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public Integer addz() {
        return userMapper.addz();
    }


    @Transactional(propagation = Propagation.NESTED)
    public Integer addw() {
        int result = userMapper.addw();
        int a = 1 / 0;
        return result;
    }


}
